package com.bbcare.switchData.controller;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bbcare.comm.ResultModel;
import com.bbcare.followup.plat.service.impl.PatientPhoneService;
import com.bbcare.followup.plat.service.impl.SmallProgramService;
import com.bbcare.switchData.entity.model.PtUserInfo;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;



@Controller
@RequestMapping(value="/switchData")
public class MqController {
    private final Log log = LogFactory.getLog(MqController.class);

    @Autowired
    private SmallProgramService smallProgramService;

    @ResponseBody
    @RequestMapping(value="/mq",produces = "application/json; charset=utf-8")
    public String selectByPropertiesWithDeptId2(@RequestBody String requestBody){
        log.info("mq消息-->" +requestBody);
        try{
            smallProgramService.MqttBusiness(requestBody);
        }catch (Exception ex){
            log.error(ex);
        }
        return "success";
    }


}
